<template>
  <div class="vote-closed-flag" v-if="new Date()>=new Date(deadline)">
    <span>
      已结束
    </span>
  </div>
  <div class="vote-opened-flag" v-else-if="new Date()<new Date(deadline)">
    <span>
      进行中
    </span>
  </div>
</template>

<style lang="less">
.vote-closed-flag {
  // text-align: right;
  // font-size: 0;
  // -webkit-text-size-adjust: none;
  span {
    // margin-top: -1rem;
    // margin-right: -1rem;
    position: absolute;
    top: 0;
    right: 0;
    // width: 1.5rem;
    width: 2.5rem;
    height: 1.25rem;
    display: inline-block;
    font-size: .8rem;
    line-height: 1.25rem;
    padding: 0 .4rem;
    background-color: #c0c4cc;
    color: white;
  }
}

.vote-opened-flag {
  // text-align: right;
  // font-size: 0;
  // -webkit-text-size-adjust: none;
  span {
    // margin-top: -1rem;
    // margin-right: -1rem;
    position: absolute;
    top: 0;
    right: 0;
    width: 2.5rem;
    height: 1.25rem;
    display: inline-block;
    font-size: .8rem;
    line-height: 1.25rem;
    padding: 0 0.4rem;
    background-color: #fe9c6d;
    color: white;
  }
}
</style>


<script>
export default {
  name: "VoteFlag",
  props: ["deadline"]
};
</script>
